package com.run.info;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @description:
 * @project springboot_demo
 * @author HeWenWen
 * @date 2024-09-10 17:53
 * @version 1.0
 */
@Component
@ConfigurationProperties(prefix = "app")
//指定配置文件
//@PropertySource(value = "classpath:testperson.properties")
public class Person {

//    @Value("张三")
//    @Value("${name}")
    private String name;
//    @Value("${age}")
    private int age;
    private List<Object> lists;
    private Map<Object,Object> maps;
    private List<String> language;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<Object> getLists() {
        return lists;
    }

    public void setLists(List<Object> lists) {
        this.lists = lists;
    }

    public Map<Object, Object> getMaps() {
        return maps;
    }

    public void setMaps(Map<Object, Object> maps) {
        this.maps = maps;
    }

    public List<String> getLanguage() {
        return language;
    }

    public void setLanguage(List<String> language) {
        this.language = language;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", lists=" + lists +
                ", maps=" + maps +
                ", language=" + language +
                '}';
    }
}
